package com.ruoyi.system.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;

import javax.validation.constraints.NotBlank;
import java.util.List;

/**
 * 试卷信息对象 sys_exam_paper
 *
 * @author ruoyi
 * @date 2025-09-17
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@FieldDefaults(level = AccessLevel.PRIVATE)
@TableName(value = "sys_exam_paper", autoResultMap = true)
public class SysExamPaper extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @Excel(name = "试卷ID")
    Long id;



    @Excel(name = "试卷名称")
    @NotBlank(message = "试卷名称不能为空")
    String title;

    @Excel(name = "试卷描述")
    @NotBlank(message = "试卷描述不能为空")
    String questDesc;

    @Excel(name = "试卷内容")
    @TableField(value = "frame_text_content",typeHandler = JacksonTypeHandler.class)
    List<ExamPaperTitleItemObject> frameTextContent;

    @Excel(name = "题目数量")
    Long questionCount;

    @Excel(name = "试卷总分")
    Long score;

    @TableLogic
    String delFlag;


    @TableField(exist = false)
    List<SysQuestion> questions;
}
